<?php
/**
 * Created by PhpStorm.
 * User: jun
 * Date: 2015/2/9
 * Time: 17:51
 */

namespace Avos;

class AVLibraryException  extends \Exception{
    public function __construct($message, $code = 0, \Exception $previous = null) {
        //codes are only set by a AVOSCloud.com error
        if($code != 0){
            $message = "AVOSCloud.com error: ".$message;
        }

        parent::__construct($message, $code, $previous);
    }

    public function __toString() {
        return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
    }
} 